package com.zxp.server.controller;


import com.zxp.server.config.Result;
import com.zxp.server.service.IMessageService;
import com.zxp.server.vo.Message;
import org.springframework.web.bind.annotation.*;


import javax.annotation.Resource;

/**
 * <p>
 *  留言功能的前端控制器
 * </p>
 *
 * @author fangjiale
 * @since 2021-02-08
 */
@RestController
@CrossOrigin
@RequestMapping("/message")
public class MessageController {
    @Resource
    private IMessageService messageService;

    @GetMapping("/getMessageList")
    public Result getMessageList(){
        return Result.success("获取留言列表信息成功",messageService.getMessageList());
    }

    @PostMapping("/add")
    public Result addMessage(@RequestBody Message message){
        return Result.success("添加留言成功",messageService.addMessage(message));
    }
}

